<!--{include header.htm}-->

<div class="width">
	<form action="?user-update-uid-$user[uid].htm" method="post" id="user_update_form">
		<input type="hidden" name="FORM_HASH" value="{FORM_HASH}" />
		
		<div class="div" style="width: 700px;">
			<div class="header">修改用户资料</div>
			<div class="body">
				<dl>
					<dt><label for="email">Email：</label></dt>
					<dd><input type="text" name="email" id="email" value="$user[email]" style="width: 250px;" /></dd>
					
					<dt><label for="uid">UID：</label></dt>
					<dd>$user[uid]</dd>
					
					<dt><label for="username">用户名：</label></dt>
					<dd>$user[username]</dd>
					
					<dt><label for="password">密码：</label></dt>
					<dd><input type="text" name="password" id="password" value="" style="width: 150px;" /> <span class="grey">不修改请留空</span></dd>
					
					<dt><label for="groupid">用户组：</label></dt>
					<dd>$input[groupid]</dd>
					
					<dt><label for="threads">主题数：</label></dt>
					<dd>$input[threads]</dd>
					
					<dt><label for="posts">回帖数：</label></dt>
					<dd>$input[posts]</dd>
					
					<dt><label for="credits">总积分：</label></dt>
					<dd>$input[credits]</dd>
					
					<dt><label for="golds">金币：</label></dt>
					<dd>$input[golds]</dd>
					
					<!--{hook admin_user_update_submit_before.htm}-->
					
					<dt></dt>
					<dd>
						<input type="submit" class="button bigblue" id="user_update_submit" value="修改用户" />
						<input type="submit" class="button bigblue" id="user_access_submit" value="禁止用户" />
						<input type="submit" class="button bigblue" id="user_delete_submit" value="删除用户" />
						<input type="button" class="button biggrey" value="返回" onclick="history.back()" />
						<div class="notice" id="notice" style="display: none;"></div>
					</dd>
				</dl>
			</div>
		</div>
	</form>
</div>
<!--{include footer.htm}-->

<script type="text/javascript">
$('#user_update_submit').click(function() {
	$('#user_update_form').submit();
	return false;
});
$('#user_access_submit').click(function() {
	//window.location = '?user-access-uid-$user[uid].htm';
	window.open('?mod-manageuser-do-banuser-uid-$user[uid].htm');
	return false;
});
$('#user_delete_submit').click(function() {
	if($user[groupid] < 6) {
		if(window.confirm('该用户不是普通用户，您确定删除吗？')) {
			window.open('?mod-manageuser-do-deleteuser-uid-$user[uid].htm');
		}
	} else if($user[posts] > 5000) {
		if(window.confirm('该用户发帖超过了5000，删除该用户可能会导致超时，您确定删除吗？')) {
			window.open('?mod-manageuser-do-deleteuser-uid-$user[uid].htm');
		}
	} else {
		window.open('?mod-manageuser-do-deleteuser-uid-$user[uid].htm');
	}
	
	return false;
});

<!--{loop $error $k $v}-->
	$('#$k').alert('$v');
<!--{/loop}-->

<!--{if $_POST && !$error}-->
	$('#notice').html('修改用户成功！').show();
<!--{/if}-->

</script>

<!--{hook admin_user_update_end.htm}-->

</body>
</html>